package org.example.facade;

/**
 * @author
 * @description
 */
public class HomeTheaterFacade {

    private TheaterLight theaterLight;
    private Popcorn popcorn;
    private Stereo stereo;
    private Projector projector;
    private Screen screen;
    private DVDPlayer dvdPlayer;

    //无参构造函器
    public HomeTheaterFacade() {
        super();
        theaterLight = theaterLight.getInstance();
        popcorn = popcorn.getInstance();
        stereo = stereo.getInstance();
        projector = projector.getInstance();
        screen = screen.getInstance();
        dvdPlayer = dvdPlayer.getInstance();
    }

    //操作分成四步
    public void ready() {
        popcorn.on();
        popcorn.pop();
        screen.down();
        projector.on();
        stereo.on();
        dvdPlayer.on();
        theaterLight.dim();
    }

    public void play() {
        dvdPlayer.play();
    }

    public void pause() {
        dvdPlayer.pause();
    }

    public void end() {
        popcorn.off();
        theaterLight.bright();
        screen.up();
        projector.off();
        stereo.off();
        dvdPlayer.off();
    }
}
